const RechargeOptionModel = require('../model').rechargeOptionModel;
const DaoTool = require('../lib/daoTool');
exports.selectOption = function (conn) {
    return new Promise(function (resolve, reject) {
        conn.query("select * from recharge_option order by AddTimes ASC;", [], function (err, result) {
            printLog("=selectOption=", this.sql);
            if (err) reject(err);
            resolve(result)
        });
    });
};
exports.updateOption = function (conn,params) {
    return new Promise(function (resolve, reject) {
        conn.query("update recharge_option set ? where RechargeOptionId=?;", [DaoTool.generateModelObject(params, RechargeOptionModel, 'update'), params.RechargeOptionId], function (err, result) {
            printLog("=updateOption=", this.sql);
            if (err) reject(err);
            resolve(result)
        });
    });
};